package com.ljw.webserviceserver.demo;

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

/**
 * @Author LiuJunWen
 * @Date 2020/4/28 20:49
 */
public class Test {
    public static void main(String[] args) {
        JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
        jaxWsProxyFactoryBean.setAddress("http://localhost:8080/service/user?wsdl");
        jaxWsProxyFactoryBean.setServiceClass(UserWebService.class);

        UserWebService userService = (UserWebService) jaxWsProxyFactoryBean.create();
        String name = userService.getName("Java");
        System.out.println("name:" + name);
    }
}
